cmake_minimum_required(VERSION 3.4)
project(D3D11_Guide)

set(EFFECTS11_LIB_NAME Effects11)

add_library(${EFFECTS11_LIB_NAME} STATIC IMPORTED)

set_target_properties(${EFFECTS11_LIB_NAME} PROPERTIES
    IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/Common/Effects11.lib
    IMPORTED_LOCATION_DEBUG ${CMAKE_SOURCE_DIR}/Common/Effects11d.lib
    )

add_compile_definitions(
    UNICODE
    _UNICODE
    _WIN32_WINNT=0x0601
    )

add_compile_options(
    /wd4018 # warning C4018: '<': signed/unsigned mismatch
    /wd4244 # warning C4244: 'argument': conversion from 'int' to 'float'
    /wd4267 # warning C4267: '=': conversion from 'size_t' to
    /wd4838 # warning C4838: conversion from 'const uint32_t' to 'int32_t' requires a narrowing conversion
    )

add_subdirectory("Common")

include_directories(${CMAKE_SOURCE_DIR}/Common)

link_libraries(
    d3d11.lib
    d3dcompiler.lib
    ${COMMON_LIB_NAME}
    ${EFFECTS11_LIB_NAME}
    )

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")

#add_subdirectory("SelectedCodeSolutions/CSGpuWavesDemo")
#add_subdirectory("SelectedCodeSolutions/DepthStencilBolt")
#add_subdirectory("SelectedCodeSolutions/DisplacementMappedWaves")
#add_subdirectory("SelectedCodeSolutions/GSSubdivision")
#add_subdirectory("SelectedCodeSolutions/TexturedColumns")
add_subdirectory("Chapter 1 Vector Algebra/XMVECTOR")
add_subdirectory("Chapter 2 Matrix Algebra/XMMATRIX")
add_subdirectory("Chapter 4 Direct3D Initialization/Init Direct3D")
add_subdirectory("Chapter 6 Drawing in Direct3D/Box")
add_subdirectory("Chapter 6 Drawing in Direct3D/Hills")
add_subdirectory("Chapter 6 Drawing in Direct3D/Shapes")
add_subdirectory("Chapter 6 Drawing in Direct3D/Skull")
add_subdirectory("Chapter 6 Drawing in Direct3D/Waves")
add_subdirectory("Chapter 7 Lighting/Lighting")
add_subdirectory("Chapter 7 Lighting/LitSkull")
add_subdirectory("Chapter 8 Texturing/Crate")
add_subdirectory("Chapter 8 Texturing/TexturedHillsAndWaves")
add_subdirectory("Chapter 9 Blending/BlendDemo")
add_subdirectory("Chapter 10 Stenciling/Mirror")
add_subdirectory("Chapter 11 The Geometry Shader/TreeBillboard")
add_subdirectory("Chapter 12 The Compute Shader/Blur")
add_subdirectory("Chapter 12 The Compute Shader/VecAdd")
add_subdirectory("Chapter 13 The Tessellation Stages/BasicTessellation")
add_subdirectory("Chapter 13 The Tessellation Stages/BezierPatch")
add_subdirectory("Chapter 14 Building a First Person Camera/Camera")
add_subdirectory("Chapter 15 Instancing and Frustum Culling/InstancingAndCulling")
#add_subdirectory("Chapter 16 Picking/Picking")
#add_subdirectory("Chapter 17 Cube Mapping/CubeMap")
#add_subdirectory("Chapter 17 Cube Mapping/DynamicCubeMap")
#add_subdirectory("Chapter 18 Normal and Displacement Mapping/NormalDisplacementMap")
#add_subdirectory("Chapter 19 Terrain Rendering/Terrain")
#add_subdirectory("Chapter 20 Particle Systems/ParticleSystem")
#add_subdirectory("Chapter 21 Shadow Mapping/Shadows")
#add_subdirectory("Chapter 22 Ambient Occlusion/AmbientOcclusion")
#add_subdirectory("Chapter 22 Ambient Occlusion/Ssao")
#add_subdirectory("Chapter 23 Meshes/MeshView")
#add_subdirectory("Chapter 24 Quaternions/Quaternions")
#add_subdirectory("Chapter 25 Character Animation/SkinnedMesh")
